//package pers.mobian.springtenth;
//
//import org.springframework.beans.BeansException;
//import org.springframework.beans.factory.config.BeanDefinition;
//import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
//import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.ApplicationContextAware;
//import org.springframework.stereotype.Component;
//
//@Component
//public class SpringUtils implements ApplicationContextAware, BeanFactoryPostProcessor {
//    private static ApplicationContext applicationContext;
//    private static ConfigurableListableBeanFactory factory;
//
//    public SpringUtils() {
//    }
//
//    public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
//        System.out.println("bean工厂-configurableListableBeanFactory 正在实例化");
//        this.factory = configurableListableBeanFactory;
////		Object teacher = getBeanDefine("teacher");
//	}
//
//    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//        System.out.println("容器-applicationContext 正在实例化");
//        this.applicationContext = applicationContext;
//		Object teacher = getBeanDefine("teacher");
//
//	}
//
//    public static Object getObject(String name) {
//        Object object = null;
//        object = applicationContext.getBean(name);
//        return object;
//    }
//
//    public static BeanDefinition getBeanDefine(String name) {
//        System.out.println("factory------------" + applicationContext.getBean(name));
////        BeanDefinition beanDefinition = factory.getBeanDefinition(name);
////        beanDefinition.setAttribute("age", 21);
////        return beanDefinition;
//		return null;
//    }
//
//    public static String[] getActiveProfiles() {
//        return applicationContext.getEnvironment().getActiveProfiles();
//    }
//}
